package com.shengsiyuan.lesson4;

public class ArraySearchTest {

	public static void main(String[] args) {
		int[] a = new int[] {1, 5, 6, 7, 10, 3, 9};
		System.out.println(search(11,a));
		System.out.println();
	}
	public static int search(int value, int[] array){
		for(int i = 0; i < array.length; i++){
			if (value == array[i])
			return i+1;
		}
		return -1;
	}
}
